'use strict';

function grouping_count(collection) {

  let countNum=collection.reduce(function(allNum,num){
    if(num in allNum){
       allNum[num]++;
    }
    else{
      allNum[num]=1;
    }
    return allNum;
  },[]);
  return countNum;
}

module.exports = grouping_count;
